#ifndef BOOSTERS_H
#define BOOSTERS_H

#include "drawable.h"
#include "updateable.h"

#include "component.h"

class Boosters : public Drawable, public Updateable, public Component {
	private:
	bool on;

	cpVect force_;
	cpVect pos_;
	cpVect dir_;

	cpVect * vertii_;
	int numVertii_;
	float aR;
	float aG;
	float aB;
	float aA;

	float bR;
	float bG;
	float bB;
	float bA;

	float cR;
	float cG;
	float cB;
	float cA;
	
	cpVect * portVertii_;
	int numPortVertii_;

	float pR;
	float pG;
	float pB;
	float pA;

	float eR;
	float eG;
	float eB;
	float eA;

	public:
		Boosters(cpBody* host, float force, cpVect pos, cpVect dir) : Drawable(2), Component(host) {
		on = false;
		
		pos_ = pos;
		dir_ = cpvnormalize(dir);
		force_ = cpvmult(dir_, force);

		numVertii_ = 5;
		vertii_ = new cpVect[numVertii_];
		vertii_[0].x =  0.5; vertii_[0].y =  -2.0;
		vertii_[1].x =  2.0; vertii_[1].y =  -7.0;
		vertii_[2].x =  0.0; vertii_[2].y = -17.0;
		vertii_[3].x = -2.0; vertii_[3].y =  -7.0;
		vertii_[4].x = -0.5; vertii_[4].y =  -2.0;
		
		aR = 1.0;
		aG = 1.0;
		aB = 1.0;
		aA = 1.0;

		bR = 1.0;
		bG = 1.0;
		bB = 0.0;
		bA = 0.75;

		cR = 1.0;
		cG = 0.0;
		cB = 0.0;
		cA = 0.0;

		numPortVertii_ = 4;
		portVertii_ = new cpVect[numPortVertii_];
		portVertii_[0].x =  0.5; portVertii_[0].y =  1.0;
		portVertii_[1].x =  1.0; portVertii_[1].y = -2.0;
		portVertii_[2].x = -1.0; portVertii_[2].y = -2.0;
		portVertii_[3].x = -0.5; portVertii_[3].y =  1.0;
		
		pR = 0.2;
		pG = 0.2;
		pB = 0.2;
		pA = 1.0;
	}
	
    void draw();

	void update(float step);

	inline void activate() {on = true;}
	inline void deactivate() {on = false;}
};
	
#endif
